﻿
using System;
using System.Web.Mvc;
using MVCWeb.Models;
using System.Configuration;

namespace MVCWeb.Controllers
{

    public class BaseController : Controller
    {

        //protected HOACRMDataContext dc = new HOACRMDataContext();

        //DataLoadOptions options = new DataLoadOptions();
        //options.AssociateWith<Category>(cat=> cat.Products.Where<Product>(prod => !prod.Discontinued));
        //dc.LoadOptions = options;
        protected HOACRMDataContext dc = new HOACRMDataContext();

        protected override ViewResult View(string viewName, string masterName, object model)
        {
            try
            {
                if (viewName == "Print")
                    return base.View(viewName, "Blank", model);
            }
            catch (Exception)
            {
            }
            return base.View(viewName, ConfigurationManager.AppSettings["MasterPageName"], model);
        }
    }
}
